/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session;

import java.util.Date;
import javax.ejb.EJB;
import javax.ejb.Schedule;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;

/**
 *
 * @author Lionel Prado
 */
@Stateless
@LocalBean
public class Timer {
    @EJB
    GestionnaireDeCompteBancaire gestionnaireDeCompteBancaire;
    
    @Schedule(minute = "*", second = "*/10", dayOfMonth = "*", month = "*", year = "*", hour = "9-17", dayOfWeek = "Mon-Fri")
    public void myTimer() {
        System.out.println("Timer event start : " + new Date());
        gestionnaireDeCompteBancaire.incrementerSoldeCompteEpargne(); 
        System.out.println("Timer event end : " + new Date());
    }
}


